<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 180px;
            height: 200px;
            background-color: aqua;
        }
        .active{
             width: 180px;
            height: 200px;
            background-color: rgb(236, 14, 44);
        }
    </style>
</head>
<body>
    <button class="btn">按钮</button>
     <div class="box">

     </div>
     <script>
      let btn=   document.querySelector(".btn")

       let box=    document.querySelector(".box")
    
       btn.onclick=function() {
         box.classList.toggle("active")
       }

     </script>
</body>
</html>